package alinesno.cloud.busines.demo.gateway.dto;


import com.alinesno.cloud.common.facade.dto.BaseDto;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * 功能名： 学院
 * 数据表：  learn_college
 * @author wh ${authorEmail}
 * @date 2021-09-06 22:52:32
 */
public class LearnCollegeDto extends BaseDto {
    private static final long serialVersionUID = 1L;
    // fields
        /**
         *  "collegeName"
         */
        private String collegeName;
        /**
         *  "collegeNumber"
         */
        private Long collegeNumber;
    //getter and setter
        public String getCollegeName()

        {
            return this.collegeName;
        }

        public LearnCollegeDto setCollegeName(String arg) {
            this.collegeName = arg;
            return this;
        }
        public Long getCollegeNumber()

        {
            return this.collegeNumber;
        }

        public LearnCollegeDto setCollegeNumber(Long arg) {
            this.collegeNumber = arg;
            return this;
        }

    /**
    * 快速从 dto 转换成 entity
    * @return  dto 对应的 entity
    */
    public LearnCollegeDto mapToDto() {
        ObjectMapper toDtoMapper = new ObjectMapper();
        toDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return toDtoMapper.convertValue(this,LearnCollegeDto.class);
    }

    /**
    * 快速从 entity 转换成 dto
    * @return  dto 对应的 entity
    */
    public LearnCollegeDto fromDto(LearnCollegeDto entity) {
        ObjectMapper fromDtoMapper = new ObjectMapper();
        fromDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return fromDtoMapper.convertValue(entity,LearnCollegeDto.class);
    }

}
